package com.ruyuan.eshop.construction.converter;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruyuan.eshop.common.core.PageResult;
import com.ruyuan.eshop.construction.domain.dto.BuyerInfoDTO;
import com.ruyuan.eshop.construction.domain.entity.BuyerInfoDO;
import com.ruyuan.eshop.construction.domain.request.BuyerRequest;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

/**
 * 品类相关对象克隆
 * @author zhonghuashishan
 * @version 1.0
 */
@Mapper(componentModel = "spring")
public interface BuyerConverter {

    /**
     * 对象克隆
     * @param attributeRequest
     * @return
     */
    @Mapping(target = "updateUser", source = "operateUser")
    BuyerInfoDO converterDO(BuyerRequest attributeRequest);

    /**
     * 对象克隆
     * @param buyerInfoDO
     * @return
     */
    BuyerInfoDTO converterDTO(BuyerInfoDO buyerInfoDO);

    /**
     * 对象克隆
     * @param list
     * @return
     */
    List<BuyerInfoDTO> converterDTOList(List<BuyerInfoDO> list);

    /**
     * 对象克隆
     * @param buyerInfoPage
     * @return
     */
    PageResult<BuyerInfoDTO> converterPageResult(Page<BuyerInfoDO> buyerInfoPage);
}
